package org.openeai.lite.router.processors;

import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.log4j.Logger;
import org.openeai.lite.common.util.DateTimeUtils;


/**
 * TODO type description.
 *
 */
public class MessageLoggingProcessor implements Processor
{

    private static Logger log = Logger.getLogger(MessageLoggingProcessor.class);
    
    @Override
    public void process(Exchange exchange) throws Exception
    {
        log.info("\n***** RECIEVED MESSAGE *****" +
                 "\nTimestamp     : " +DateTimeUtils.now() +
                 "\nMessage ID    : " + exchange.getExchangeId() +
                 "\nRoute ID      : " + exchange.getFromRouteId().toString() +        
                 "\nFrom endpoint : " + exchange.getFromEndpoint().getEndpointUri().toString() +
                 "\n****************************");
        
    }

}
